/*
 * @Author: HuRrongChao zhuangpiao@qingmutec.com
 * @Date: 2024-10-09 14:16:43
 * @LastEditors: HuRrongChao
 * @LastEditTime: 2025-04-22 19:56:28
 * @FilePath: \rc_-short-video\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 创建路由
import { createWebHashHistory, createRouter } from 'vue-router'
// 引入组件
import Recommend from '../views/recommendVideo.vue'
import Home from '../views/homeVideo.vue'
import MyVideo from '../views/myVideo.vue'
import Friends from '../views/friends.vue'
import SchoolSelect from '../views/schoolSelect.vue'
import ConfessionWall from '../views/confessionWall.vue'
import Forum from '../views/forum.vue'
import Test from '../views/Test.vue'

// 创建并暴露一个路由器
export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: 'schoolSelect' //路由重定向
    },
    {
      name: 'recommend',
      path: '/recommend',
      component: Recommend
    },
    {
      name: 'home',
      path: '/home',
      component: Home
    },
    {
      name: 'friends',
      path: '/friends',
      component: Friends
    },
    {
      name: 'schoolSelect',
      path: '/schoolSelect',
      component: SchoolSelect
    },
    {
      name: 'confessionWall',
      path: '/confessionWall',
      component: ConfessionWall
    },
    {
      name: 'forum',
      path: '/forum',
      component: Forum
    },
    {
      name: 'myVideo',
      path: '/myVideo',  // 添加可选参数
      component: MyVideo,
      props: true
    },
    {
      name: 'test',
      path: '/test',
      component: Test
    }
  ]
})